package com.eric.controller;

import com.eric.dao.AttendanceInfoDao;
import com.eric.entity.AttendanceInfoEntity;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: eric
 * @create: 2024-06-07 09:51
 */
@RestController
@RequestMapping("/test")
@RequiredArgsConstructor
public class Controller {

    private final AttendanceInfoDao attendanceInfoDao;

    @PostMapping("/save")
    public void save(@RequestBody List<AttendanceInfoEntity> attendanceInfoEntities) {
        for (AttendanceInfoEntity attendanceInfoEntity : attendanceInfoEntities) {
            attendanceInfoDao.insert(attendanceInfoEntity);
        }
    }

}
